#include <iostream>
#include <algorithm>

using namespace std;

typedef struct
{   
    int strong;
    int score;
    int index;
} Data;

bool compare(const Data& a, const Data& b)
{
    if (a.score > b.score) return true;
    if (a.score < b.score) return false;
    if (a.index < b.index) return true;
    else return false;    
}

Data datas[1000086];
int main(int argc, char const *argv[])
{
    int n, r, q;
    int i, j, k;

    cin >> n >> r >> q;

    for (i = 0; i < 2 * n; i++)
        datas[i].index = i + 1;

    for (i = 0; i < 2 * n; i++)
        cin >> datas[i].score;

    for (i = 0; i < 2 * n; i++)
        cin >> datas[i].strong;

    sort(datas, datas + 2 * n, compare);

    for (i = 0; i < r; i++)
    {
        for (j = 0; j < 2 * n; j += 2)
        {
            if (datas[j].strong > datas[j + 1].strong)
                datas[j].score++;
            else
                datas[j + 1].score++;
        }

        stable_sort(datas, datas + 2 * n, compare);
    }

    cout << datas[q - 1].index;

    return 0;
}
